package com.meichis.yndms.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.meichis.mcsappframework.adapter.recyclerview.CommonAdapter;
import com.meichis.mcsappframework.adapter.recyclerview.base.ViewHolder;
import com.meichis.yndms.R;
import com.meichis.yndms.common.MCode;
import com.meichis.yndms.model.Staff;
import com.meichis.yndms.ui.activity.VstTravelActivity;

import java.util.List;

/**
 * @author xmy
 * @title
 * @remake
 * @create 2021-05-25 16:49
 */
public class StaffAdapter extends CommonAdapter<Staff> {

    public StaffAdapter(Context context, int layoutId, List<Staff> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, Staff staff, int position) {
        holder.setText(R.id.tv_name, staff.getRealName());
        holder.setText(R.id.tv_tel, staff.getMobile());
        holder.setOnClickListener(R.id.ll_item, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(mContext, VstTravelActivity.class);
                intent.putExtra(MCode.STAFF,staff.getDMSID());
                mContext.startActivity(intent);
            }
        });
    }
}
